﻿<!--
Copyright © Pavel Fedarovich, 2010-2012

This file is part of AvalonWizard.
 
You may at your option receive a license to Avalon Wizard under 
either the terms of the Apache License version 2.0 or 
the GNU Lesser General Public License (LGPL) version 2.1 or any later version.
 
AvalonWizard is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
You may obtain a copy of the Apache License at [http://www.apache.org/licenses/LICENSE-2.0].
You may obtain a copy of the LGPL at [http://www.gnu.org/licenses/].
-->
<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:aero="clr-namespace:AvalonWizard.Aero" 
    xmlns:conv="clr-namespace:AvalonWizard.Converters" 
    xmlns:local="clr-namespace:AvalonWizard">

    <conv:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
    <conv:BooleanInverterConvertor x:Key="BooleanInverter" />
    <conv:VisibilityMultiConverter x:Key="VisibilityMultiConverter" />

    <SolidColorBrush x:Key="BackButtonStrokeNormal" Color="#808080" />
    <SolidColorBrush x:Key="BackButtonFillNormal" Color="White" />
    <SolidColorBrush x:Key="BackButtonArrowStrokeNormal" Color="Transparent" />
    <SolidColorBrush x:Key="BackButtonArrowFillNormal" Color="#808080" />

    <SolidColorBrush x:Key="BackButtonStrokeHover" Color="#3298FE" />
    <SolidColorBrush x:Key="BackButtonFillHover" Color="#3298FE" />
    <SolidColorBrush x:Key="BackButtonArrowStrokeHover" Color="Transparent" />
    <SolidColorBrush x:Key="BackButtonArrowFillHover" Color="White" />

    <SolidColorBrush x:Key="BackButtonStrokePressed" Color="#1566A9" />
    <SolidColorBrush x:Key="BackButtonFillPressed" Color="#1566A9" />
    <SolidColorBrush x:Key="BackButtonArrowStrokePressed" Color="Transparent" />
    <SolidColorBrush x:Key="BackButtonArrowFillPressed" Color="White" />

    <Style x:Key="BackButtonStyle" TargetType="{x:Type Button}">
        <Setter Property="OverridesDefaultStyle" Value="true" />
        <Setter Property="Focusable" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid Width="24" Height="24" Background="Transparent">
                        <Ellipse Name="Circle" StrokeThickness="1.5" 
                                 Fill="{StaticResource BackButtonFillNormal}" 
                                 Stroke="{StaticResource BackButtonStrokeNormal}"
                                 Width="20" Height="20"/>
                        <Path Name="Arrow" VerticalAlignment="Center" HorizontalAlignment="Center" StrokeThickness="0" 
                              Data="M-0.5,4.75 l4.5,4.5 h3 l-3.5,-3.5 h7 v-2 h-7 l3.5,-3.5 h-3 l-4.5,4.5"
                              Stroke="{StaticResource BackButtonArrowStrokeNormal}" 
                              Fill="{StaticResource BackButtonArrowFillNormal}" 
                              StrokeStartLineCap="Triangle" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Opacity" Value="0.4" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Fill" Value="{StaticResource BackButtonFillHover}" TargetName="Circle" />
                            <Setter Property="Stroke" Value="{StaticResource BackButtonStrokeHover}" TargetName="Circle" />
                            <Setter Property="Fill" Value="{StaticResource BackButtonArrowFillHover}" TargetName="Arrow" />
                            <Setter Property="Stroke" Value="{StaticResource BackButtonArrowStrokeHover}" TargetName="Arrow" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter Property="Fill" Value="{StaticResource BackButtonFillPressed}" TargetName="Circle" />
                            <Setter Property="Stroke" Value="{StaticResource BackButtonStrokePressed}" TargetName="Circle" />
                            <Setter Property="Fill" Value="{StaticResource BackButtonArrowFillPressed}" TargetName="Arrow" />
                            <Setter Property="Stroke" Value="{StaticResource BackButtonArrowStrokePressed}" TargetName="Arrow" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <ControlTemplate TargetType="{x:Type aero:AeroWizardHeader}" x:Key="AeroWizardHeader_Aero2_ControlTemplate">
        <Grid Background="{TemplateBinding Background}" Height="34" IsHitTestVisible="True">
            <Grid.Resources>
                <Style TargetType="TextBlock" x:Key="AeroWizardHeaderTextBlockStyle">
                    <Setter Property="HorizontalAlignment" Value="Left" />
                    <Setter Property="VerticalAlignment" Value="Center" />
                    <Setter Property="FontFamily" Value="{DynamicResource {x:Static SystemFonts.CaptionFontFamilyKey}}" />
                    <Setter Property="FontSize" Value="{DynamicResource {x:Static SystemFonts.CaptionFontSizeKey}}" />
                    <Setter Property="FontStyle" Value="{DynamicResource {x:Static SystemFonts.CaptionFontStyleKey}}" />
                    <Setter Property="FontWeight" Value="{DynamicResource {x:Static SystemFonts.CaptionFontWeightKey}}" />
                    <Setter Property="TextDecorations" Value="{DynamicResource {x:Static SystemFonts.CaptionFontTextDecorationsKey}}" />
                    <Setter Property="Text" Value="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=Title, Mode=OneWay}" />
                </Style>
            </Grid.Resources>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="30" />
                <ColumnDefinition Width="26" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition Height="5" />
            </Grid.RowDefinitions>
            <Button Grid.Column="0" Margin="1,0" HorizontalAlignment="Center" VerticalAlignment="Center" Style="{StaticResource BackButtonStyle}" Command="{x:Static Member=local:WizardCommands.PreviousPage}" Visibility="{Binding RelativeSource={RelativeSource AncestorType=local:Wizard}, Path=CurrentPage.ShowBack,
                    Converter={StaticResource BooleanToVisibilityConverter}}" />
            <Image Grid.Column="1" Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center" Source="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=Icon}" />
            <TextBlock Grid.Column="2" Name="PART_caption" Style="{StaticResource AeroWizardHeaderTextBlockStyle}" HorizontalAlignment="Stretch"/>
        </Grid>
    </ControlTemplate>

    <Style TargetType="aero:AeroWizardHeader">
        <Setter Property="Template" Value="{StaticResource AeroWizardHeader_Aero2_ControlTemplate}" />
        <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ActiveCaptionColorKey}}" />
        <Style.Triggers>
            <Trigger Property="IsActive" Value="False">
                <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.InactiveCaptionColorKey}}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style TargetType="{x:Type aero:AeroWizardPageChrome}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type aero:AeroWizardPageChrome}">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Border Grid.Row="0" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="Transparent" BorderThickness="0">
                            <ContentPresenter />
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>